//+--------------------------------------------------------------------------------
//| Copyright (c) 2012 - 2013 ### an.vuongngocduy
//| This file is a part of Compact Game Engine (CGE)
//+--------------------------------------------------------------------------------
#ifndef __CGE_TEXTURE_H__
#define __CGE_TEXTURE_H__

#include "cgeCommons.h"
#include "cgeEnums.h"
#include "cgeString.h"

using namespace cge::std;

namespace cge
{
	namespace gfx
	{
		class Texture
		{
		public:
			//! Destructor
			virtual ~Texture();


			//! Return the real width of created texture
			u32 Width() const;


			//! Return the real height of created texture
			u32 Height() const;

			
			//! Return the depth of created texture
			u32 Depth() const;


			//! Return the name of current texture
			String Identifier() const;


			//! Return the pixel format of current texture
			EPixelFormat PixelFormat() const;
			

			//! Return the renderer type that created current texture
			ERendererDriver RendererDriver() const;


			//! Get texture wrap mode
			ETextureWrapMode GetWrapMode() const;


			//! Set texture wrap mode
			void SetWrapMode(ETextureWrapMode wm);

			
			//! Return number of mipmaps generated for the current texture
			u32 GetNumMipmaps() const;


			//! Set number of mipmaps that will be generated for current texture
			u32 SetNumMipmaps(u32 nMMaps);


		protected:
			//! Locked default constructor
			Texture();


		protected:
			obj_t mHandle;

			String mIdentifier;	
			
			u32 mMipmapCount;
			
			u32 mWidth, mHeight, mDepth;
			
			EPixelFormat mFormat;
			
			ERendererDriver mDriver;
			
			ETextureWrapMode mTexWrapModes[3]; //x, y, z
			
			ETextureUnit mTexUnit;
		};

		typedef Texture* TexturePtr; //pointer
	}
}

#endif//__CGE_TEXTURE_H__